<layout name="layout"/>
<include file="Public:angular"/>
<load href="__PUBLIC__/{:UIKIT}/css/components/notify.css"/>
<load href="__PUBLIC__/{:UIKIT}/js/components/notify.min.js"/>
<load href="__PUBLIC__/Common/dist/jquery.validate.min.js"/>
<script>
App.controller("applyCtrl",["$http","$interval","$scope",function($http,$interval,$scope){

$scope.apply_data={
email_button_default:"Send verify code",
default_time:60,
disable:false
};

$scope.emailSend=function(url,hash_code){

reg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
if(!reg.test($scope.apply_data.app_email)){
	UIkit.notify("{$Think.lang.invalid_email}",{status:'warning'});
	return;
}
post_url=url+"/hash_code/"+hash_code+"/email/"+$scope.apply_data.app_email;

$.getJSON(post_url,function(data){
	UIkit.notify(data.info,{status:'warning'});
});

$scope.apply_data.disable=true;
var timer=$interval ( function ( ){
$scope.apply_data.default_time--;
if($scope.apply_data.default_time==0){
$interval. cancel ( timer );
$scope.apply_data.disable=false;
}
},1000);
}



}]);

$(function(){
	$("#validate_form").validate();
})
</script>	
<div class="tm-section-20"></div>
<div class="tm-section-color-1">
<div class="uk-container uk-container-center">	
<div class="uk-block uk-contrast uk-block-large">

    <h1 class="uk-article-title"><i class='uk-icon-line-chart'></i>
		Get your approval,and better your business.</h1>

</div>		
</div>
</div>
<div class="tm-section-20"></div>
<div class="uk-container uk-container-center">	
	

<div class="uk-grid uk-grid-divider">
	<div class="uk-width-1-3">
		
<dl class="uk-description-list-line">
    <dt>32432</dt>
    <dd>fdsfdsfdsfdsf</dd>
    <dt>32432</dt>
    <dd>fdsfdsfdsfdsf</dd>
    <dt>32432</dt>
    <dd>fdsfdsfdsfdsf</dd>
    <dt>32432</dt>
    <dd>fdsfdsfdsfdsf</dd>
    <dt>32432</dt>
    <dd>fdsfdsfdsfdsf</dd>
    <dt>32432</dt>
    <dd>fdsfdsfdsfdsf</dd>	
</dl>
	</div>
	<div class="uk-width-2-3">
		
<form ng-controller="applyCtrl" id="validate_form" class="uk-form uk-form-stacked" method="post" action="__CONTROLLER__/handleApply">
    <div class="uk-form-row">
        <label class="uk-form-label" >Your Email</label>
        <div class="uk-form-controls"><input type="text" name="app_email" ng-model="apply_data.app_email" required email="true" class="uk-width-2-3"/>
		<br>
		<button type="button" ng-disabled="apply_data.disable" ng-click="emailSend('__CONTROLLER__/postmail','{$hash_code}')" 
		class="uk-button uk-button-primary">{{apply_data.disable?apply_data.default_time+" S ...":apply_data.email_button_default}}</button>
		</div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Verify code</label>
        <div class="uk-form-controls"><input type="text" name="email_code" required class="uk-width-1-3"/>
		</div>
    </div>	
    <div class="uk-form-row">
        <label class="uk-form-label" >Your name</label>
        <div class="uk-form-controls"><input type="text" name="app_name" required class="uk-width-2-3"/></div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Your phone number</label>
        <div class="uk-form-controls"><input type="text" name="app_phone" required class="uk-width-2-3"/></div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Your country</label>
        <div class="uk-form-controls">
        	<select name="app_country" required>
				<option value="">--</option>
				<volist name=":getCountryList()" id="vo">
				<option value="{$vo.countries_name}">{$vo.countries_name}</option>
				</volist>
			</select>	
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Your state</label>
        <div class="uk-form-controls"><input type="text" name="app_state" required class="uk-width-2-3"/></div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Your web domain</label>
        <div class="uk-form-controls"><input type="text" name="app_web" required url="true" class="uk-width-2-3"/></div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Online shopping products&services</label>
        <div class="uk-form-controls">
        <textarea class="uk-width-2-3" name="app_service" required></textarea>	
			
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label" >Monthly volumn</label>
        <div class="uk-form-controls">
        	<select name="app_monthly_volumn" required>
				<option value="">--</option>
				<volist name=":monthlyVolumn()" id="vo">
				<option value="{$key}">{$vo}</option>
				</volist>
			</select>
        </div>
    </div>		
    <div class="uk-form-row">
        <label class="uk-form-label" >Chargeback rate</label>
        <div class="uk-form-controls">
    	<select name="app_cb_rate" required>
			<option value="">--</option>
				<volist name=":chargebackRate()" id="vo">
				<option value="{$key}">{$vo}</option>
				</volist>
		</select>	
			
        </div>
    </div>	
    <div class="uk-form-row">
        <label class="uk-form-label" >Any questions?</label>
        <div class="uk-form-controls"><textarea class="uk-width-2-3" required name="app_question"></textarea></div>
    </div>	
	<div class="uk-form-row">
	<button class='uk-button uk-button-success'>Send</button>	
</div>						
</form>
		
	</div>
</div>		
	
</div>			
<div class="tm-section-20"></div>